﻿Imports System.Transactions
Imports Sistema_InformacionNaviera.BE
Imports Sistema_InformacionNaviera.DALC


Public Class BillOfLadingExpoBC

    Public Function InsertarBLExpo(ByVal objBlExpoBE As BillOfLadingExpoBE, ByRef bExito As Boolean, ByRef sMensaje As String) As Boolean

        Dim objScope As TransactionScope
        objScope = New TransactionScope


        Using objScope
            Try
                Dim objBLExpoDALC As BillOfLadingExpoDALC = Nothing
                objBLExpoDALC = New BillOfLadingExpoDALC

                objBLExpoDALC.InsertarBLExpo(objBlExpoBE, bExito, sMensaje)

                objScope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return bExito
    End Function


    Public Function ModificarBLimportacion(ByVal objBlExpoBE As BillOfLadingExpoBE, ByRef bExito As Boolean, ByRef sMensaje As String) As Boolean

        Dim objScope As TransactionScope
        objScope = New TransactionScope


        Using objScope
            Try
                Dim objBLExpoDALC As BillOfLadingExpoDALC = Nothing
                objBLExpoDALC = New BillOfLadingExpoDALC

                objBLExpoDALC.InsertarBLExpo(objBlExpoBE, bExito, sMensaje)

                objScope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return bExito
    End Function

    Public Function ListarBlExpo(ByVal objBlExpoBE As BillOfLadingExpoBE) As List(Of BillOfLadingExpoBE)
        Dim objListaBlList As List(Of BillOfLadingExpoBE) = Nothing
        Dim objBlExpoDALC As BillOfLadingExpoDALC = Nothing

        objBlExpoDALC = New BillOfLadingExpoDALC
        objListaBlList = New List(Of BillOfLadingExpoBE)()
        objListaBlList = objBlExpoDALC.ConsultarBLExportacion(objBlExpoBE)

        Return objListaBlList
    End Function

    'Public Function ObtieneBlImpoCabecera(ByVal objBlImpoBE As BillOfLadingImpoBE, ByRef bExito As Boolean, ByRef sMensaje As String) As List(Of BillOfLadingExpoBE)
    '    Dim objListaBlList As List(Of BillOfLadingExpoBE) = Nothing
    '    Dim objBlImpoDALC As BillOfLadingExpoDALC = Nothing

    '    objBlImpoDALC = New BillOfLadingExpoDALC
    '    objListaBlList = New List(Of BillOfLadingExpoBE)()
    '    objListaBlList = objBlImpoDALC.ObtieneBLImpo(objBlImpoBE, bExito, sMensaje)

    '    Return objListaBlList
    'End Function

    'Public Function ListarDetalleMercaderiaExpoList(ByVal objBlImpoBE As BillOfLadingImpoBE, ByRef dt As DataTable, ByRef bExito As Boolean, ByRef sMensaje As String) As List(Of BillOfLadingImpoBE)

    '    Dim objListaBlList As List(Of BillOfLadingImpoBE) = Nothing
    '    Dim objBlImpoDALC As BillOfLadingImpoDALC = Nothing

    '    objBlImpoDALC = New BillOfLadingImpoDALC
    '    objListaBlList = New List(Of BillOfLadingImpoBE)()
    '    objListaBlList = objBlImpoDALC.ListarDetalleMercaderiaImpo(objBlImpoBE, dt, bExito, sMensaje)

    '    Return objListaBlList
    'End Function



    Public Function EliminarBlImpo(ByVal objBlExpoBE As BillOfLadingExpoBE, ByRef bExito As Boolean, ByRef sMensaje As String) As Boolean

        Dim objScope As TransactionScope
        objScope = New TransactionScope


        Using objScope
            Try
                Dim objBlExpoDALC As BillOfLadingExpoDALC = Nothing
                objBlExpoDALC = New BillOfLadingExpoDALC

                objBlExpoDALC.EliminarBlExpo(objBlExpoBE, bExito, sMensaje)

                objScope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return bExito
    End Function

End Class
